<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMemberTable extends Migration
{
    public function up()
    {
        //通用会员表
        Schema::create('member', function (Blueprint $table) {
            $table->increments('id');
          //  $table->string('username',50)->unique()->comment('用户名');
            $table->string('password')->comment('密码');
            $table->string('nick_name',20)->nullable()->comment('昵称');
            $table->string('mobile',13)->unique()->nullable()->comment('手机');         //->unique()
            $table->string('email',50)->unique()->nullable()->comment('邮箱');          //->unique()
            $table->string('avatar')->nullable()->comment('用户头像');
	        $table->unsignedDecimal('cash',10,2)->default(0)->comment('现金');
	        $table->string('qq',10)->default('')->nullable()->comment('QQ');
	        $table->string('wechat',32)->default('')->nullable()->comment('微信');
            $table->unsignedTinyInteger('status')->default(2)->comment('1禁止,2正常');
            $table->ipAddress('last_ip')->nullable()->comment('最后登录IP');
	        $table->unsignedInteger('login_count')->nullable()->comment('登录次数');
            $table->timestamp('last_login')->nullable()->comment('最后登录时间');
            $table->boolean('deleted')->default(false)->comment('删除');
            $table->rememberToken()->comment('记住登录状态');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::dropIfExists('member');
    }
}
